<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>shipjssdk.js | Threadv</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="shipjssdk.js1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787">
<meta name="keywords" content="util">
<meta property="og:type" content="article">
<meta property="og:title" content="shipjssdk.js">
<meta property="og:url" content="http://yoursite.com/2018/10/29/shipjssdk.js/index.html">
<meta property="og:site_name" content="Threadv">
<meta property="og:description" content="shipjssdk.js12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989">
<meta property="og:updated_time" content="2020-03-29T11:01:38.428Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="shipjssdk.js">
<meta name="twitter:description" content="shipjssdk.js12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989">
  
    <link rel="alternate" href="/atom.xml" title="Threadv" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Threadv</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Suche"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-shipjssdk.js" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/10/29/shipjssdk.js/" class="article-date">
  <time datetime="2018-10-29T10:41:35.000Z" itemprop="datePublished">2018-10-29</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      shipjssdk.js
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h5 id="shipjssdk-js"><a href="#shipjssdk-js" class="headerlink" title="shipjssdk.js"></a>shipjssdk.js</h5><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * Created by wslhk on 2018/5/14.</span></span><br><span class="line"><span class="comment"> * storyship jssdk 1.5</span></span><br><span class="line"><span class="comment"> * 增加confirm，增加2.5相关协议</span></span><br><span class="line"><span class="comment"> * 增加微信分享配置</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">var</span> shipjssdk=<span class="keyword">new</span> <span class="function"><span class="keyword">function</span>(<span class="params">configObj</span>)</span>&#123;</span><br><span class="line">    <span class="keyword">this</span>.userAgent=navigator.userAgent;</span><br><span class="line">    <span class="keyword">this</span>.appVer=<span class="string">"0"</span>;</span><br><span class="line">    <span class="keyword">this</span>.isAppIos=<span class="literal">false</span>;</span><br><span class="line">    <span class="keyword">this</span>.isAppAndroid=<span class="literal">false</span>;</span><br><span class="line">    <span class="keyword">this</span>.isTestVer=<span class="literal">false</span>;</span><br><span class="line">    <span class="keyword">this</span>.token=<span class="string">''</span>;</span><br><span class="line">    <span class="keyword">this</span>.isApp=<span class="literal">false</span>;<span class="comment">//是否是app</span></span><br><span class="line">    <span class="keyword">this</span>.isMicroMessenger=<span class="literal">false</span>;</span><br><span class="line">    <span class="keyword">this</span>.pageConfig=&#123;</span><br><span class="line">        appActivityAuthErrPage:<span class="string">''</span><span class="comment">//app没有登录提示页</span></span><br><span class="line">        ,<span class="attr">microMessageActivityAuthErrpage</span>:<span class="string">''</span> <span class="comment">//微信没有登录的提示页如  https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx31edd56a45a12c7f&amp;redirect_uri=https%3A%2F%2Fwx.storybook.ifenghui.com%2Factpaydemo&amp;response_type=code&amp;scope=snsapi_userinfo&amp;state=STATE#wechat_redirect'//微信没有授权提示页</span></span><br><span class="line">        ,<span class="attr">otherActiveAuthErrPage</span>:<span class="string">''</span><span class="comment">//除了微信和app的渠道，分享页</span></span><br><span class="line">        ,</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">if</span>(configObj)&#123;</span><br><span class="line">        <span class="keyword">this</span>.pageConfig=configObj;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">this</span>.requestUrl = <span class="string">'//xxx.xxxxx.com/sale'</span>;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span>(location.href.indexOf(<span class="string">'storybook'</span>) !=<span class="number">-1</span>&amp;&amp;location.href.indexOf(<span class="string">'localhost'</span>) ==<span class="number">-1</span>)&#123;</span><br><span class="line">        <span class="comment">// alert(1);</span></span><br><span class="line">        <span class="keyword">this</span>.requestUrl = <span class="string">'//storybook.xxxxx.com/sale'</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    _this=<span class="keyword">this</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">var</span> httpPost=<span class="function"><span class="keyword">function</span>(<span class="params">url,params,callback</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">var</span> ajax = <span class="keyword">new</span> XMLHttpRequest();</span><br><span class="line">        <span class="comment">// 使用post请求</span></span><br><span class="line">        ajax.open(<span class="string">'post'</span>,url);</span><br><span class="line">        <span class="comment">// 如果 使用post发送数据 必须 设置 如下内容</span></span><br><span class="line">        <span class="comment">// 修改了 发送给 服务器的 请求报文的 内容</span></span><br><span class="line">        <span class="comment">// 如果需要像 HTML 表单那样 POST 数据，请使用 setRequestHeader() 来添加 HTTP 头。然后在 send() 方法中规定您希望发送的数据：</span></span><br><span class="line">        ajax.setRequestHeader(<span class="string">"Content-type"</span>,<span class="string">"application/x-www-form-urlencoded"</span>);</span><br><span class="line">        <span class="comment">// 发送</span></span><br><span class="line">        <span class="comment">// post请求 发送的数据 写在 send方法中</span></span><br><span class="line">        <span class="comment">// 格式 name=jack&amp;age=18 字符串的格式</span></span><br><span class="line">        ajax.send(params);</span><br><span class="line">        <span class="comment">// 注册事件</span></span><br><span class="line">        ajax.onreadystatechange = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="keyword">if</span> (ajax.readyState==<span class="number">4</span>&amp;&amp;ajax.status==<span class="number">200</span>) &#123;</span><br><span class="line">                respObj=<span class="built_in">JSON</span>.parse(ajax.responseText);</span><br><span class="line">                callback(respObj);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">var</span> httpGet=<span class="function"><span class="keyword">function</span>(<span class="params">url,callback</span>)</span>&#123;</span><br><span class="line">        <span class="comment">//步骤一:创建异步对象</span></span><br><span class="line">        <span class="keyword">var</span> ajax = <span class="keyword">new</span> XMLHttpRequest();</span><br><span class="line"><span class="comment">//步骤二:设置请求的url参数,参数一是请求的类型,参数二是请求的url,可以带参数,动态的传递参数starName到服务端</span></span><br><span class="line">        ajax.open(<span class="string">'get'</span>,url);</span><br><span class="line"><span class="comment">//步骤三:发送请求</span></span><br><span class="line">        ajax.send();</span><br><span class="line"><span class="comment">//步骤四:注册事件 onreadystatechange 状态改变就会调用</span></span><br><span class="line">        ajax.onreadystatechange = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="keyword">if</span> (ajax.readyState==<span class="number">4</span> &amp;&amp;ajax.status==<span class="number">200</span>) &#123;</span><br><span class="line">                <span class="comment">//步骤五 如果能够进到这个判断 说明 数据 完美的回来了,并且请求的页面是存在的</span></span><br><span class="line">                <span class="comment">// console.log(ajax.responseText);//输入相应的内容</span></span><br><span class="line">                respObj=<span class="built_in">JSON</span>.parse(ajax.responseText);</span><br><span class="line">                <span class="comment">// console.log('----------------------')</span></span><br><span class="line">                <span class="comment">// console.log(respObj)</span></span><br><span class="line">                callback(respObj);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">this</span>.getVersion=<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">        verkey=<span class="string">"storyship/"</span>;</span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.isAppAndroid)&#123;</span><br><span class="line">            verkey=<span class="string">"storyship/"</span>;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.userAgent.indexOf(verkey)!=<span class="number">-1</span>)&#123;</span><br><span class="line">            begin=<span class="keyword">this</span>.userAgent.indexOf(verkey)</span><br><span class="line">            end=<span class="keyword">this</span>.userAgent.indexOf(<span class="string">";"</span>,begin)</span><br><span class="line">            <span class="keyword">if</span>(end==<span class="number">-1</span>)&#123;</span><br><span class="line">                end=<span class="keyword">this</span>.userAgent.length;</span><br><span class="line">            &#125;</span><br><span class="line">            ver=<span class="keyword">this</span>.userAgent.substr(begin+verkey.length,end-(begin+verkey.length));</span><br><span class="line">            <span class="keyword">this</span>.appVer=ver;</span><br><span class="line">            <span class="keyword">if</span>(ver.substr(<span class="number">0</span>,<span class="number">1</span>)==<span class="string">'0'</span>)&#123;</span><br><span class="line">                <span class="keyword">this</span>.isTestVer=<span class="literal">true</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">this</span>.getPlatform=<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.userAgent.indexOf(<span class="string">'Android_'</span>)!=<span class="number">-1</span>&amp;&amp;<span class="keyword">this</span>.userAgent.indexOf(<span class="string">'storyship'</span>)!=<span class="number">-1</span>)&#123;</span><br><span class="line">            <span class="keyword">this</span>.isAppAndroid=<span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.userAgent.indexOf(<span class="string">'AppleWebKit'</span>)!=<span class="number">-1</span>&amp;&amp;<span class="keyword">this</span>.userAgent.indexOf(<span class="string">'storyship'</span>)!=<span class="number">-1</span>)&#123;</span><br><span class="line">            <span class="keyword">this</span>.isAppIos=<span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>( <span class="keyword">this</span>.isAppAndroid||<span class="keyword">this</span>.isAppIos)&#123;</span><br><span class="line">            <span class="keyword">this</span>.isApp=<span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.userAgent.indexOf(<span class="string">'MicroMessenger'</span>)!=<span class="number">-1</span>)&#123;</span><br><span class="line">            <span class="keyword">this</span>.isMicroMessenger=<span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">this</span>.GetQueryString=<span class="function"><span class="keyword">function</span>(<span class="params">name</span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> reg = <span class="keyword">new</span> <span class="built_in">RegExp</span>(<span class="string">"(^|&amp;)"</span> + name + <span class="string">"=([^&amp;]*)(&amp;|$)"</span>);</span><br><span class="line">        <span class="keyword">var</span> r = <span class="built_in">window</span>.location.search.substr(<span class="number">1</span>).match(reg);</span><br><span class="line">        <span class="keyword">if</span>(r != <span class="literal">null</span>) <span class="keyword">return</span> <span class="built_in">unescape</span>(r[<span class="number">2</span>]);</span><br><span class="line">        <span class="keyword">return</span> <span class="literal">null</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">this</span>.getToken=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">        tokenQ=<span class="keyword">this</span>.GetQueryString(<span class="string">'sstoken'</span>);</span><br><span class="line">        <span class="keyword">if</span>(tokenQ!=<span class="literal">null</span>&amp;&amp;tokenQ!=<span class="string">''</span>)&#123;</span><br><span class="line">            sessionStorage.setItem(<span class="string">'token'</span>,tokenQ);</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            tokenQ=sessionStorage.getItem(<span class="string">'token'</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.token=tokenQ;</span><br><span class="line">        <span class="keyword">return</span> <span class="keyword">this</span>.token;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//1.1 支持</span></span><br><span class="line">    <span class="keyword">this</span>.limitVer=<span class="function"><span class="keyword">function</span>(<span class="params">verStr</span>)</span>&#123;</span><br><span class="line">        <span class="comment">//输入最次版本号，支持返回true，不支持返回false</span></span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.isApp==<span class="literal">false</span>)&#123;</span><br><span class="line">            <span class="comment">//不是app不支持</span></span><br><span class="line">            <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.compareVer(verStr)==<span class="number">1</span>)&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//版本判断和警告</span></span><br><span class="line">    <span class="keyword">this</span>.limitVerAndAlert=<span class="function"><span class="keyword">function</span>(<span class="params">verStr</span>)</span>&#123;</span><br><span class="line">        <span class="comment">//输入最次版本号，支持返回true，不支持返回false</span></span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.isApp==<span class="literal">false</span>)&#123;</span><br><span class="line">            <span class="comment">//不是app不支持</span></span><br><span class="line">            shipjssdk.showDialogAndHide(<span class="string">'请注意'</span>,<span class="string">'请点击'</span>,<span class="string">'确认'</span>,<span class="number">2000</span>)</span><br><span class="line">            <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="keyword">this</span>.compareVer(verStr)==<span class="number">1</span>)&#123;</span><br><span class="line">            shipjssdk.showDialog(<span class="string">'请注意'</span>,<span class="string">'当前版本不支持，请升级到'</span>+verStr+<span class="string">'以上的版本'</span>,<span class="string">'确认'</span>)</span><br><span class="line">            <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//比较版本大小</span></span><br><span class="line">    <span class="keyword">this</span>.compareVer=<span class="function"><span class="keyword">function</span>(<span class="params">verStr</span>)</span>&#123;</span><br><span class="line">        <span class="comment">//大于限制</span></span><br><span class="line">        <span class="comment">// 如果输入版本大于当前版本返回1</span></span><br><span class="line">        <span class="comment">// 如果输入版本小于当前版本返回-1</span></span><br><span class="line">        <span class="comment">// 版本相等返回0</span></span><br><span class="line">        currentVer=<span class="keyword">this</span>.appVer;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span>(currentVer.substr(<span class="number">0</span>,<span class="number">1</span>)==<span class="string">'0'</span>&amp;&amp;currentVer.length&gt;<span class="number">4</span>)&#123;</span><br><span class="line">            currentVer=currentVer.substr(<span class="number">2</span>,currentVer.length<span class="number">-2</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        currentVerArr=currentVer.split(<span class="string">'.'</span>);</span><br><span class="line">        inputVerArr=verStr.split(<span class="string">'.'</span>)</span><br><span class="line">        <span class="keyword">if</span>(currentVerArr.length!=<span class="number">3</span>||inputVerArr.length!=<span class="number">3</span>)&#123;</span><br><span class="line">            <span class="built_in">console</span>.log(<span class="string">"ver set error"</span>);</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="built_in">Number</span>(inputVerArr[<span class="number">0</span>])&gt;<span class="built_in">Number</span>(currentVerArr[<span class="number">0</span>]))&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">1</span></span><br><span class="line">        &#125;<span class="keyword">else</span> <span class="keyword">if</span>(<span class="built_in">Number</span>(inputVerArr[<span class="number">0</span>])&lt;<span class="built_in">Number</span>(currentVerArr[<span class="number">0</span>]))&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">-1</span></span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="comment">// return 0</span></span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="built_in">Number</span>(inputVerArr[<span class="number">1</span>])&gt;<span class="built_in">Number</span>(currentVerArr[<span class="number">1</span>]))&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">1</span></span><br><span class="line">        &#125;<span class="keyword">else</span> <span class="keyword">if</span>(<span class="built_in">Number</span>(inputVerArr[<span class="number">1</span>])&lt;<span class="built_in">Number</span>(currentVerArr[<span class="number">1</span>]))&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">-1</span></span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="comment">// return 0</span></span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(<span class="built_in">Number</span>(inputVerArr[<span class="number">2</span>])&gt;<span class="built_in">Number</span>(currentVerArr[<span class="number">2</span>]))&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">1</span></span><br><span class="line">        &#125;<span class="keyword">else</span> <span class="keyword">if</span>(<span class="built_in">Number</span>(inputVerArr[<span class="number">2</span>])&lt;<span class="built_in">Number</span>(currentVerArr[<span class="number">2</span>]))&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">-1</span></span><br><span class="line">        &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">            <span class="keyword">return</span> <span class="number">0</span></span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//初始化</span></span><br><span class="line">    <span class="keyword">this</span>.getPlatform();</span><br><span class="line">    <span class="keyword">this</span>.getVersion();</span><br><span class="line">    <span class="keyword">this</span>.getToken();</span><br><span class="line">    <span class="comment">//协议调用</span></span><br><span class="line">    that=<span class="keyword">this</span>;</span><br><span class="line">    <span class="keyword">this</span>.appMethod=<span class="keyword">new</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">       </span><br><span class="line">        <span class="keyword">this</span>.modeIframe=<span class="function"><span class="keyword">function</span> (<span class="params">url</span>) </span>&#123;</span><br><span class="line">            <span class="comment">//iframe模式打开</span></span><br><span class="line">            <span class="keyword">var</span> shipui_link = <span class="built_in">document</span>.createElement(<span class="string">"iframe"</span>);</span><br><span class="line">            shipui_link.src = url;</span><br><span class="line">            shipui_link.width = <span class="number">0</span>;</span><br><span class="line">            shipui_link.height = <span class="number">0</span>;</span><br><span class="line">            shipui_link.style.display=<span class="string">'none'</span>;</span><br><span class="line">            <span class="keyword">var</span> ss = <span class="built_in">document</span>.getElementsByTagName(<span class="string">"body"</span>)[<span class="number">0</span>];</span><br><span class="line">            ss.parentNode.insertBefore(shipui_link, ss);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="comment">//登录</span></span><br><span class="line">        <span class="keyword">this</span>.ss_login=<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            location.href=<span class="string">'storyship://story?method=SS_Login'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_authredirect=<span class="function"><span class="keyword">function</span>(<span class="params">url</span>)</span>&#123;</span><br><span class="line">            <span class="comment">//!!!!!!!!!!有安全风险，需要限定域名</span></span><br><span class="line">            location.href=<span class="string">'storyship://story?method=SS_AuthRedirect&amp;url='</span>+<span class="built_in">encodeURIComponent</span>(url);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_playstory=<span class="function"><span class="keyword">function</span>(<span class="params">storyid</span>)</span>&#123;</span><br><span class="line">            location.href=<span class="string">'storyship://story?method=SS_PlayStory&amp;id='</span>+<span class="built_in">Number</span>(storyid);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_showserialstory=<span class="function"><span class="keyword">function</span>(<span class="params">sid</span>)</span>&#123;</span><br><span class="line">            location.href=<span class="string">'storyship://story?method=SS_ShowSerialStory&amp;id='</span>+<span class="built_in">Number</span>(sid);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_resetshareurl=<span class="function"><span class="keyword">function</span>(<span class="params">url</span>)</span>&#123;</span><br><span class="line">            <span class="comment">//设置分享地址</span></span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.0.0'</span>))&#123;</span><br><span class="line">                <span class="keyword">this</span>.modeIframe(<span class="string">'storyship://story?method=SS_ResetShareURL&amp;url='</span>+<span class="built_in">encodeURIComponent</span>(url));</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_sendsharecallbackurl=<span class="function"><span class="keyword">function</span>(<span class="params">url</span>)</span>&#123;</span><br><span class="line">            <span class="comment">//设置分享回调地址</span></span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.0.0'</span>))&#123;</span><br><span class="line">                <span class="keyword">this</span>.modeIframe(<span class="string">'storyship://story?method=SS_SendShareCallbackURL&amp;url='</span>+<span class="built_in">encodeURIComponent</span>(url));</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">//试用兑换码</span></span><br><span class="line">        <span class="keyword">this</span>.ss_usecode=<span class="function"><span class="keyword">function</span>(<span class="params">url</span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.0.1'</span>))&#123;</span><br><span class="line">                location.href=<span class="string">'storyship://story?method=SS_UseCode&amp;url='</span>+<span class="built_in">encodeURIComponent</span>(url);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.ss_payactivity=<span class="function"><span class="keyword">function</span>(<span class="params">id,amount</span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.1.0'</span>))&#123;</span><br><span class="line">                location.href=<span class="string">'storyship://story?method=SS_PayActivity&amp;id='</span>+<span class="built_in">Number</span>(id)+<span class="string">"&amp;amount="</span>+amount;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_resetbgcolor=<span class="function"><span class="keyword">function</span>(<span class="params">bgcolor</span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.2.0'</span>))&#123;</span><br><span class="line">                <span class="keyword">this</span>.modeIframe(<span class="string">'storyship://story?method=SS_ResetBgColor&amp;color='</span>+bgcolor);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.ss_paylesson=<span class="function"><span class="keyword">function</span>(<span class="params">priceId,lessonId,refresh</span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.2.0'</span>))&#123;</span><br><span class="line">                <span class="keyword">if</span>(refresh)&#123;</span><br><span class="line">                    location.href=<span class="string">'storyship://story?method=SS_PayLesson&amp;priceId='</span>+priceId+<span class="string">'&amp;lessonId='</span>+lessonId+<span class="string">'&amp;refresh='</span>+refresh;</span><br><span class="line">                &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                    location.href=<span class="string">'storyship://story?method=SS_PayLesson&amp;priceId='</span>+priceId+<span class="string">'&amp;lessonId='</span>+lessonId;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.ss_openlessonitem=<span class="function"><span class="keyword">function</span>(<span class="params">lessonId,itemId,refresh</span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.2.0'</span>))&#123;</span><br><span class="line">                <span class="keyword">if</span>(refresh)&#123;</span><br><span class="line">                    location.href=<span class="string">'storyship://story?method=SS_OpenClassItem&amp;lessonId='</span>+lessonId+<span class="string">"&amp;itemId="</span>+itemId+<span class="string">"&amp;refresh="</span>+refresh;</span><br><span class="line">                &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                    location.href=<span class="string">'storyship://story?method=SS_OpenClassItem&amp;lessonId='</span>+lessonId+<span class="string">"&amp;itemId="</span>+itemId;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.ss_refresh=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.2.0'</span>))&#123;</span><br><span class="line">                    <span class="keyword">this</span>.modeIframe(<span class="string">'storyship://story?method=SS_OpenClassItem&amp;refresh=1'</span>);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.ss_open_sharemenu=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.2.0'</span>)) &#123;</span><br><span class="line">                location.href = <span class="string">'storyship://story?method=SS_OpenShareMenu'</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.ss_open_svip=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.4.0'</span>)) &#123;</span><br><span class="line">                location.href = <span class="string">'storyship://story?method=SS_OpenSVip'</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_open_ad=<span class="function"><span class="keyword">function</span>(<span class="params">id</span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.5.0'</span>)) &#123;</span><br><span class="line">                location.href = <span class="string">'storyship://story?method=SS_OpenAd&amp;id='</span>+id;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.ss_open_readplan=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.limitVerAndAlert(<span class="string">'2.5.0'</span>)) &#123;</span><br><span class="line">                location.href = <span class="string">'storyship://story?method=SS_OpenReadPlan'</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">function</span> <span class="title">loadBack</span>(<span class="params">e</span>)</span>&#123;</span><br><span class="line">        e.preventDefault();</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//dialog</span></span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 提示窗口，代替alert</span></span><br><span class="line"><span class="comment">     * @param title</span></span><br><span class="line"><span class="comment">     * @param content</span></span><br><span class="line"><span class="comment">     * @param btntext</span></span><br><span class="line"><span class="comment">     * @param callback</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="keyword">this</span>.showDialog=<span class="function"><span class="keyword">function</span>(<span class="params">title,content,btntext,callback</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(!btntext)&#123;</span><br><span class="line">            btntext=<span class="string">'确认'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(!title)&#123;</span><br><span class="line">            title=<span class="string">'请注意'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(!content)&#123;</span><br><span class="line">            content=<span class="string">'提示文字'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">var</span> dialogHtml=<span class="string">'&lt;div class="js_dialog"  style="opacity: 1;"&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-mask"&gt;&lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-alert shipui-dialog"&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-dialog-title"&gt;&lt;strong&gt;'</span>+title+<span class="string">'&lt;/strong&gt;&lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-dialog-content"&gt;'</span>+content+<span class="string">'&lt;/div&gt;\</span></span><br><span class="line"><span class="string">    &lt;div class="shipui-dialog-btn"&gt;\</span></span><br><span class="line"><span class="string">        &lt;a href="javascript:;" class="shipui-dialog-ok" &gt;'</span>+btntext+<span class="string">'&lt;/a&gt;\</span></span><br><span class="line"><span class="string">        &lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;/div&gt;'</span>;</span><br><span class="line"></span><br><span class="line">        dialogAddListener(dialogHtml);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">this</span>.showConfirm=<span class="function"><span class="keyword">function</span>(<span class="params">title,content,btntext,callback</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(!btntext)&#123;</span><br><span class="line">            btntext=<span class="string">'确认'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(!title)&#123;</span><br><span class="line">            title=<span class="string">'请注意'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(!content)&#123;</span><br><span class="line">            content=<span class="string">'提示文字'</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">var</span> dialogHtml=<span class="string">'&lt;div class="js_dialog"  style="opacity: 1;"&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-mask"&gt;&lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-alert shipui-dialog shipui-dialog-confirm"&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-dialog-title"&gt;&lt;strong&gt;'</span>+title+<span class="string">'&lt;/strong&gt;&lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-dialog-content"&gt;'</span>+content+<span class="string">'&lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;div class="shipui-dialog-btn"&gt;\</span></span><br><span class="line"><span class="string">        &lt;a href="javascript:;" class="shipui-dialog-cancel" &gt;取消&lt;/a&gt;\</span></span><br><span class="line"><span class="string">        &lt;a href="javascript:;" class="shipui-dialog-ok" &gt;'</span>+btntext+<span class="string">'&lt;/a&gt;\</span></span><br><span class="line"><span class="string">        &lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;/div&gt;\</span></span><br><span class="line"><span class="string">        &lt;/div&gt;'</span>;</span><br><span class="line"></span><br><span class="line">        dialogAddListener(dialogHtml,callback);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="function"><span class="keyword">function</span> <span class="title">dialogAddListener</span>(<span class="params">dialogHtml,callback</span>) </span>&#123;</span><br><span class="line">        <span class="keyword">var</span> hm = <span class="built_in">document</span>.createElement(<span class="string">"div"</span>);</span><br><span class="line">        hm.id = <span class="string">'shipui-dialog-queue'</span>;</span><br><span class="line">        hm.innerHTML=dialogHtml;</span><br><span class="line">        <span class="keyword">var</span> s = <span class="built_in">document</span>.getElementsByTagName(<span class="string">"body"</span>)[<span class="number">0</span>];</span><br><span class="line">        s.appendChild(hm);</span><br><span class="line">        <span class="built_in">document</span>.getElementsByClassName(<span class="string">'shipui-dialog-ok'</span>)[<span class="number">0</span>].addEventListener(<span class="string">'click'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="built_in">document</span>.getElementById(<span class="string">'shipui-dialog-queue'</span>).remove();</span><br><span class="line"></span><br><span class="line">            <span class="built_in">window</span>.removeEventListener(<span class="string">'touchmove'</span>, loadBack,&#123; <span class="attr">passive</span>: <span class="literal">false</span> &#125;);</span><br><span class="line">            <span class="keyword">try</span>&#123;</span><br><span class="line">                callback();</span><br><span class="line">            &#125;<span class="keyword">catch</span> (e)&#123;</span><br><span class="line"></span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">        &#125;, &#123;<span class="attr">passive</span>:<span class="literal">false</span>&#125;);</span><br><span class="line">        <span class="built_in">document</span>.getElementsByClassName(<span class="string">'shipui-dialog-cancel'</span>)[<span class="number">0</span>].addEventListener(<span class="string">'click'</span>, <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="built_in">document</span>.getElementById(<span class="string">'shipui-dialog-queue'</span>).remove();</span><br><span class="line"></span><br><span class="line">            <span class="built_in">window</span>.removeEventListener(<span class="string">'touchmove'</span>, loadBack,&#123; <span class="attr">passive</span>: <span class="literal">false</span> &#125;);</span><br><span class="line">        &#125;, &#123;<span class="attr">passive</span>:<span class="literal">false</span>&#125;);</span><br><span class="line"></span><br><span class="line">        <span class="built_in">window</span>.addEventListener(<span class="string">"touchmove"</span>,loadBack,&#123; <span class="attr">passive</span>: <span class="literal">false</span> &#125;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">this</span>.showDialogAndHide=<span class="function"><span class="keyword">function</span>(<span class="params">title,content,btntext,time</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">this</span>.showDialog(title,content,btntext);</span><br><span class="line">        setTimeout(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">            <span class="built_in">document</span>.getElementById(<span class="string">'shipui-dialog-queue'</span>).remove();</span><br><span class="line">            <span class="built_in">window</span>.removeEventListener(<span class="string">'touchmove'</span>, loadBack,&#123; <span class="attr">passive</span>: <span class="literal">false</span> &#125;);</span><br><span class="line">        &#125;,time);</span><br><span class="line">        <span class="comment">// setTimeout(time,'alert()');</span></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//微信分享</span></span><br><span class="line">    <span class="keyword">this</span>.wxShare=<span class="keyword">new</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">    <span class="comment">//增加js标签</span></span><br><span class="line"></span><br><span class="line">        <span class="keyword">this</span>.initShare=<span class="function"><span class="keyword">function</span>(<span class="params">siconUrl,stitle,sdesc,slink</span>)</span>&#123;</span><br><span class="line">        <span class="keyword">if</span>(slink.indexOf(<span class="string">'test.ifenghui.com'</span>)==<span class="number">-1</span>&amp;&amp;slink.indexOf(<span class="string">'storybook.ifenghui.com'</span>)==<span class="number">-1</span>)&#123;</span><br><span class="line">            alert(<span class="string">'微信分享的域名不支持请确认'</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(siconUrl.indexOf(<span class="string">"oss"</span>)!=<span class="number">-1</span>&amp;&amp;siconUrl.indexOf(<span class="string">"?"</span>)==<span class="number">-1</span>)&#123;</span><br><span class="line">            siconUrl=siconUrl+ <span class="string">'?x-oss-process=image/resize,m_lfit,w_100,h_100,limit_0/auto-orient,1/quality,q_80/format,jpg'</span></span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(!slink)&#123;</span><br><span class="line">            slink=<span class="built_in">window</span>.location.href</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">            httpGet(_this.requestUrl + <span class="string">'/pre_sale/get_wx_data?url='</span> + <span class="built_in">encodeURIComponent</span>(<span class="built_in">window</span>.location.href),<span class="function"><span class="keyword">function</span> (<span class="params">res</span>) </span>&#123;</span><br><span class="line">                <span class="keyword">var</span> data = res;</span><br><span class="line">                wx.config(&#123;</span><br><span class="line">                    debug: <span class="literal">false</span>,</span><br><span class="line">                    <span class="string">"appId"</span>: data.appId,</span><br><span class="line">                    <span class="string">"timestamp"</span>: <span class="built_in">parseInt</span>(data.timestamp),</span><br><span class="line">                    <span class="string">"nonceStr"</span>: data.nonceStr,</span><br><span class="line">                    <span class="string">"signature"</span>: data.signature,</span><br><span class="line">                    jsApiList: [</span><br><span class="line">                        <span class="string">'checkJsApi'</span>,</span><br><span class="line">                        <span class="string">'onMenuShareTimeline'</span>,</span><br><span class="line">                        <span class="string">'onMenuShareAppMessage'</span></span><br><span class="line">                    ]</span><br><span class="line">                &#125;);</span><br><span class="line">                wx.ready(<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">                    <span class="comment">// alert('--&gt;'+stitle+"-&gt;"+data.appId)</span></span><br><span class="line">                    <span class="keyword">var</span> shareData = &#123;</span><br><span class="line">                        title: stitle,</span><br><span class="line">                        desc: sdesc,</span><br><span class="line">                        link: slink,</span><br><span class="line">                        imgUrl: siconUrl,</span><br><span class="line">                        success: <span class="function"><span class="keyword">function</span>(<span class="params">res</span>) </span>&#123;</span><br><span class="line">                        &#125;,</span><br><span class="line">                        cancel: <span class="function"><span class="keyword">function</span>(<span class="params">res</span>) </span>&#123;&#125;</span><br><span class="line">                    &#125;;</span><br><span class="line"></span><br><span class="line">                    wx.onMenuShareAppMessage(shareData);</span><br><span class="line">                    wx.onMenuShareTimeline(shareData);</span><br><span class="line">                &#125;);</span><br><span class="line"></span><br><span class="line">                wx.error(<span class="function"><span class="keyword">function</span>(<span class="params">res</span>) </span>&#123;</span><br><span class="line">                    <span class="comment">//										alert("error: " + res.errMsg);</span></span><br><span class="line">                &#125;);</span><br><span class="line">            &#125;)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="comment">//活动相关操作</span></span><br><span class="line">    <span class="keyword">this</span>.act=<span class="keyword">new</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line"></span><br><span class="line">        requestUrl=_this.requestUrl;</span><br><span class="line">        <span class="keyword">this</span>.initAct=<span class="function"><span class="keyword">function</span>(<span class="params">callback</span>)</span>&#123;</span><br><span class="line">                <span class="comment">//判断是小程序还是app的，有没有存unionId，token</span></span><br><span class="line">            unionid=sessionStorage.getItem(<span class="string">'unionId'</span>)</span><br><span class="line">            microMessageCoce=that.GetQueryString(<span class="string">'code'</span>);</span><br><span class="line">            ssToken=that.GetQueryString(<span class="string">'sstoken'</span>);</span><br><span class="line">            sessionSSToken=sessionStorage.getItem(<span class="string">'ssToken'</span>)</span><br><span class="line"></span><br><span class="line">            <span class="comment">// requestUrl='add_wxuser';</span></span><br><span class="line">            <span class="comment">//没存，还没授权，直接跳到错误页</span></span><br><span class="line">            <span class="keyword">if</span>(that.isMicroMessenger)&#123;</span><br><span class="line">                <span class="comment">//微信需要验证unionid和授权</span></span><br><span class="line">                <span class="keyword">if</span>(!unionid)&#123;</span><br><span class="line">                    <span class="comment">//没有unionid</span></span><br><span class="line">                    <span class="comment">//看code是否存在</span></span><br><span class="line">                    <span class="keyword">if</span>(!microMessageCoce)&#123;</span><br><span class="line">                        <span class="comment">//TODO需要跳到授权登录页，或错误页</span></span><br><span class="line">                        <span class="keyword">if</span>(that.pageConfig.microMessageActivityAuthErrpage=<span class="string">''</span>)&#123;</span><br><span class="line">                             location.href=that.pageConfig.microMessageActivityAuthErrpage;</span><br><span class="line">                        &#125;</span><br><span class="line">                        <span class="keyword">return</span>;</span><br><span class="line">                    &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                        <span class="comment">//TODO需要用code进行授权登录,并设置unionid</span></span><br><span class="line">                        $.ajax(&#123;</span><br><span class="line">                            type: <span class="string">"POST"</span>,</span><br><span class="line">                            url: requestUrl + <span class="string">"/user/add_wxuser"</span>,</span><br><span class="line">                            data: &#123;</span><br><span class="line">                                code: microMessageCoce</span><br><span class="line">                            &#125;,</span><br><span class="line">                            dataType: <span class="string">"json"</span>,</span><br><span class="line">                            success: <span class="function"><span class="keyword">function</span>(<span class="params">res</span>) </span>&#123;</span><br><span class="line">                                <span class="comment">// self.token = res.body.preSaleUser.unionId;</span></span><br><span class="line">                                <span class="keyword">if</span>(res.status.code==<span class="number">0</span>)&#123;</span><br><span class="line">                                    <span class="comment">// alert('授权失败请返回重试');</span></span><br><span class="line">                                    <span class="keyword">throw</span> <span class="keyword">new</span> error(<span class="string">"授权失败请返回重试"</span>);</span><br><span class="line">                                &#125;</span><br><span class="line">                                sessionStorage.setItem(<span class="string">"unionId"</span>, res.preSaleUser.unionId);</span><br><span class="line">                                <span class="keyword">try</span>&#123;</span><br><span class="line">                                    callback(<span class="literal">true</span>);</span><br><span class="line">                                &#125;<span class="keyword">catch</span> (e)&#123;</span><br><span class="line">                                    <span class="built_in">console</span>.log(e);</span><br><span class="line">                                &#125;</span><br><span class="line">                                <span class="keyword">return</span>;</span><br><span class="line">                            &#125;</span><br><span class="line">                        &#125;)</span><br><span class="line">                        <span class="keyword">return</span>;</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line"></span><br><span class="line">            &#125;<span class="keyword">else</span> <span class="keyword">if</span>(that.isApp)&#123;</span><br><span class="line">                <span class="keyword">if</span>(!ssToken&amp;&amp;!sessionSSToken)&#123;</span><br><span class="line">                    <span class="comment">//TO-DO:需要调转到APP未登录提示页</span></span><br><span class="line">                    <span class="keyword">if</span>(that.pageConfig.appActivityAuthErrPage!=<span class="string">''</span>)&#123;</span><br><span class="line">                        location.href=that.pageConfig.appActivityAuthErrPage;</span><br><span class="line">                    &#125;</span><br><span class="line">                    <span class="keyword">return</span>;</span><br><span class="line">                &#125;<span class="keyword">else</span> <span class="keyword">if</span>(!!ssToken)&#123;</span><br><span class="line">                    sessionStorage.setItem(<span class="string">'ssToken'</span>,ssToken);</span><br><span class="line">                    <span class="keyword">try</span>&#123;</span><br><span class="line">                        callback(<span class="literal">true</span>);</span><br><span class="line">                    &#125;<span class="keyword">catch</span> (e)&#123;</span><br><span class="line">                        <span class="built_in">console</span>.log(e);</span><br><span class="line">                    &#125;</span><br><span class="line">                    <span class="keyword">return</span>;</span><br><span class="line">                &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                    <span class="keyword">try</span>&#123;</span><br><span class="line">                        callback(<span class="literal">true</span>);</span><br><span class="line">                    &#125;<span class="keyword">catch</span> (e)&#123;</span><br><span class="line">                        <span class="built_in">console</span>.log(e);</span><br><span class="line">                    &#125;</span><br><span class="line">                    <span class="keyword">return</span>;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                alert(<span class="string">'当前浏览器无法参加活动'</span>);</span><br><span class="line">                <span class="keyword">return</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="comment">// location.href=shipjssdk.pageConfig.otherActiveAuthErrPage;</span></span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;;</span><br><span class="line">        <span class="keyword">this</span>.getUnionId=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">return</span> sessionStorage.getItem(<span class="string">'unionId'</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.getSsToken=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">return</span> sessionStorage.getItem(<span class="string">'ssToken'</span>);</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.isLogin=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(sessionStorage.getItem(<span class="string">'unionId'</span>)||sessionStorage.getItem(<span class="string">'ssToken'</span>))&#123;</span><br><span class="line">                <span class="keyword">return</span> <span class="literal">true</span></span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">this</span>.getUerType=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span><br><span class="line">            <span class="keyword">if</span>(that.isApp)&#123;</span><br><span class="line">                <span class="keyword">return</span> <span class="number">1</span></span><br><span class="line">            &#125;<span class="keyword">else</span> <span class="keyword">if</span>(that.isMicroMessenger)&#123;</span><br><span class="line">                <span class="keyword">return</span> <span class="number">2</span>;</span><br><span class="line">            &#125;<span class="keyword">else</span>&#123;</span><br><span class="line">                alert(<span class="string">'用户类型异常，请确认后重试'</span>);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">//创建订单前的订单展示</span></span><br><span class="line">        <span class="keyword">this</span>.previewOrder=<span class="function"><span class="keyword">function</span>(<span class="params">goodsId</span>)</span>&#123;</span><br><span class="line">            $.ajax(&#123;</span><br><span class="line">                type: <span class="string">"GET"</span>,</span><br><span class="line">                url: requestUrl + <span class="string">"/xxx/getorder"</span>,</span><br><span class="line">                data: &#123;</span><br><span class="line">                    sstoken: that.act.getSsToken(),</span><br><span class="line">                    unionId: that.act.getUnionId(),</span><br><span class="line">                    usertype:that.act.getUerType(),</span><br><span class="line">                    goodsId:goodsId</span><br><span class="line">                &#125;,</span><br><span class="line">                dataType: <span class="string">"json"</span>,</span><br><span class="line">                success: <span class="function"><span class="keyword">function</span>(<span class="params">res</span>) </span>&#123;</span><br><span class="line">                    <span class="comment">// self.token = res.body.preSaleUser.unionId;</span></span><br><span class="line">                    sessionStorage.setItem(<span class="string">"unionId"</span>, res.body.preSaleUser.unionId);</span><br><span class="line">                    callback(<span class="literal">true</span>);</span><br><span class="line">                    <span class="keyword">return</span>;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;)</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="comment">//订单发起支付</span></span><br><span class="line">        <span class="keyword">this</span>.payOrder=<span class="function"><span class="keyword">function</span>(<span class="params">goodsId</span>)</span>&#123;</span><br><span class="line">            <span class="comment">// alert(requestUrl)</span></span><br><span class="line">            token=<span class="string">''</span>;</span><br><span class="line">            <span class="keyword">if</span>(shipjssdk.isMicroMessenger)&#123;</span><br><span class="line">                token=that.act.getUnionId();</span><br><span class="line">            &#125;<span class="keyword">else</span> <span class="keyword">if</span>(shipjssdk.isApp)&#123;</span><br><span class="line">                token=that.getToken();</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">var</span> timestamp = <span class="built_in">Date</span>.parse(<span class="keyword">new</span> <span class="built_in">Date</span>());</span><br><span class="line">            params=<span class="string">'token='</span>+token+<span class="string">'&amp;userType='</span>+that.act.getUerType()+<span class="string">'&amp;goodsId='</span>+goodsId+<span class="string">'&amp;tt='</span>+timestamp</span><br><span class="line">            httpPost(requestUrl + <span class="string">"/xxx/add_order"</span>,params,<span class="function"><span class="keyword">function</span> (<span class="params">res</span>) </span>&#123;</span><br><span class="line">                <span class="keyword">if</span>(res.status.code!==<span class="number">1</span>)&#123;</span><br><span class="line">                    shipjssdk.showDialogAndHide(<span class="string">"请注意"</span>,res.status.msg,<span class="string">'确定'</span>,<span class="number">1500</span>);</span><br><span class="line">                &#125;</span><br><span class="line">                shipjssdk.appMethod.ss_payactivity(res.preSalePay.id,res.preSalePay.price);</span><br><span class="line">            &#125;);</span><br><span class="line">           </span><br><span class="line">        &#125;</span><br><span class="line">    &#125;;<span class="comment">//act</span></span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line">(<span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">var</span> shipui_link = <span class="built_in">document</span>.createElement(<span class="string">"link"</span>);</span><br><span class="line">    shipui_link.href = <span class="string">"//test.ifenghui.com/api_web/js/shipsdk/shipui.css?a=1"</span>;</span><br><span class="line">    shipui_link.rel = <span class="string">"stylesheet"</span>;</span><br><span class="line">    shipui_link.type = <span class="string">"text/css"</span>;</span><br><span class="line">    <span class="keyword">var</span> ss = <span class="built_in">document</span>.getElementsByTagName(<span class="string">"title"</span>)[<span class="number">0</span>];</span><br><span class="line">    ss.parentNode.insertBefore(shipui_link, ss);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">var</span> wx_link = <span class="built_in">document</span>.createElement(<span class="string">"script"</span>);</span><br><span class="line">    wx_link.src = <span class="string">'//res.wx.qq.com/open/js/jweixin-1.3.0.js'</span>;</span><br><span class="line">    <span class="comment">// var ss = document.getElementsByTagName("body")[0];</span></span><br><span class="line">    ss.parentNode.insertBefore(wx_link, ss);</span><br><span class="line">&#125;)();</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2018/10/29/shipjssdk.js/" data-id="ckcc5iwlc0032q4uw4bzh0h1t" class="article-share-link">Teilen</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/util/">util</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2018/11/03/design/静态代理/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Neuer</strong>
      <div class="article-nav-title">
        
          设计模式-代理（静态代理）
        
      </div>
    </a>
  
  
    <a href="/2018/10/16/PHPoffice导出/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Älter</strong>
      <div class="article-nav-title">PHPoffice导出</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Design-Patterns/">Design Patterns</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Html/">Html</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Http/">Http</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sort/">Sort</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/algorithm/">algorithm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ali-weixin-pay/">ali/weixin pay</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/elasticsearch/">elasticsearch</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/idea/">idea</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jvm/">jvm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logstash/">logstash</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mysql/">mysql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/php/">php</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pytest/">pytest</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/springboot/">springboot</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/util/">util</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vue/">vue</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wechat/">wechat</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/我的世界/">我的世界</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/消息队列/">消息队列</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/线程/">线程</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Design-Patterns/" style="font-size: 16.36px;">Design Patterns</a> <a href="/tags/Git/" style="font-size: 10px;">Git</a> <a href="/tags/Html/" style="font-size: 10px;">Html</a> <a href="/tags/Http/" style="font-size: 12.73px;">Http</a> <a href="/tags/JavaScript/" style="font-size: 15.45px;">JavaScript</a> <a href="/tags/Sort/" style="font-size: 18.18px;">Sort</a> <a href="/tags/algorithm/" style="font-size: 11.82px;">algorithm</a> <a href="/tags/ali-weixin-pay/" style="font-size: 13.64px;">ali/weixin pay</a> <a href="/tags/docker/" style="font-size: 17.27px;">docker</a> <a href="/tags/elasticsearch/" style="font-size: 10px;">elasticsearch</a> <a href="/tags/go/" style="font-size: 11.82px;">go</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/idea/" style="font-size: 10px;">idea</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/jvm/" style="font-size: 11.82px;">jvm</a> <a href="/tags/linux/" style="font-size: 18.18px;">linux</a> <a href="/tags/logstash/" style="font-size: 12.73px;">logstash</a> <a href="/tags/mysql/" style="font-size: 14.55px;">mysql</a> <a href="/tags/php/" style="font-size: 11.82px;">php</a> <a href="/tags/pytest/" style="font-size: 10px;">pytest</a> <a href="/tags/python/" style="font-size: 13.64px;">python</a> <a href="/tags/springboot/" style="font-size: 17.27px;">springboot</a> <a href="/tags/util/" style="font-size: 19.09px;">util</a> <a href="/tags/vue/" style="font-size: 10px;">vue</a> <a href="/tags/wechat/" style="font-size: 10.91px;">wechat</a> <a href="/tags/我的世界/" style="font-size: 10px;">我的世界</a> <a href="/tags/消息队列/" style="font-size: 10.91px;">消息队列</a> <a href="/tags/线程/" style="font-size: 11.82px;">线程</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archiv</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">May 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/">March 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">January 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/">February 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/01/">January 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/">December 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">November 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/10/">October 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/09/">September 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/">July 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/">June 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/05/">May 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/">April 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/03/">March 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/">February 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/">January 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/">December 2017</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">letzter Beitrag</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/05/17/linux/linux_shell/">linux—shell</a>
          </li>
        
          <li>
            <a href="/2020/05/16/linux/linux_awk_sed/">linux-awk\sed 示例</a>
          </li>
        
          <li>
            <a href="/2020/04/11/linux/linux_bash/">linux—bash</a>
          </li>
        
          <li>
            <a href="/2020/03/29/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/2020/03/16/go基础/">go基础知识</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 vchen<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>